package cn.t.converter.order;

import cn.t.core.converter.CoreDTOConverter;
import cn.t.dto.order.ExcelReconciliationAddDTO;
import cn.t.dto.order.ReconDetailDTO;
import cn.t.model.order.ReconDetailDO;
import cn.t.request.ReconDetailReq;
import cn.t.request.api.PushReconToNidecReq;
import cn.t.vo.order.ReconDetailVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 对账单明细表(ReconDetail)dto转domain
 *
 * @author t
 * @since 2024-05-24 10:19:35
 */
@Mapper(componentModel = "spring")
public interface ReconDetailDTOConverter extends CoreDTOConverter<ReconDetailDTO, ReconDetailDO> {

    ReconDetailDO req2Do(ReconDetailReq request);

    List<ReconDetailVO> do2Vo(List<ReconDetailDO> reconDetailDOS);

    ReconDetailDO excelDto2Do(ExcelReconciliationAddDTO reconciliationAddDTO, String reconSn);

    @Mapping(target = "orderTime", expression = "java(cn.t.utils.DateUtil.getDateStr(reconDetailDO.getOrderTime()))")
    PushReconToNidecReq.Item do2PushItemDto(ReconDetailDO reconDetailDO);
    List<PushReconToNidecReq.Item> do2PushItemDto(List<ReconDetailDO> reconDetailDOS);
}

